<?php

Yii::import('common.models.db._base.BaseDeliveryMoveDetailModel');

class DeliveryMoveDetailModel extends BaseDeliveryMoveDetailModel
{
	const DETAIL_TYPE='Bảng kê chi tiết';
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	public function getAMTrackInfo($codeTicket)
	{
		$sql = "SELECT c1.*, c2.name as offat
				FROM delivery_move_detail c1
				LEFT JOIN delivery_office c2 ON c1.office_id = c2.id
				LEFT JOIN delivery_order_ticket c3 ON c1.order_ticket_id = c3.id
				WHERE c3.code = :code
				ORDER BY c1.id ASC
				";
		$command = Yii::app()->db->createCommand($sql);
		$command->bindParam(':code', $codeTicket);
		return $command->queryAll();
	}
}